var stripeHandlerNG=function (data){ jQuery('input#stripeAmount_' + data.uniq_id).keydown(function (e){ if(e.keyCode===13){ e.preventDefault(); jQuery('#asp_ng_button_' + data.uniq_id).click(); return false; }}); this.isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent); this.checkPPVisible=function (){ if(parent.iframe.find('#Aligner-item').is(':hidden')){ parent.form.submit(); return true; } setTimeout(this.checkPPVisible, 100); } this.validateAmount=function (){ var amount=jQuery('input#stripeAmount_' + data.uniq_id).val(); data.amountOpts={ applySepOpts: 0 }; data.minAmounts=[]; if(data.amountOpts.applySepOpts!=0){ amount=amount.replace(data.amountOpts.thousandSep, ''); amount=amount.replace(data.amountOpts.decimalSep, '.'); }else{ amount=amount.replace(/\$/g, ''); amount=amount.replace(/\,/g, ''); amount=amount.replace(/\ /g, ''); } amount=parseFloat(amount); if(isNaN(amount)){ jQuery('#error_explanation_' + data.uniq_id).hide().html('Enter valid amount').fadeIn('slow'); return false; } var displayAmount=amount.toFixed(2).toString(); if(data.amountOpts.applySepOpts!=0){ displayAmount=displayAmount.replace('.', data.amountOpts.decimalSep); } if(data.zeroCents.indexOf(data.currency) <=-1){ } jQuery('#error_explanation_' + data.uniq_id).html(''); jQuery('input#stripeAmount_' + data.uniq_id).val(displayAmount); return amount; } this.handleModal=function (show){ if(parent.data.show_custom_amount_input){ var pass_amount=parent.validateAmount(); if(!pass_amount){ return false; }} if(!parent.modal){ parent.modal=jQuery('div[data-asp-iframe-prod-id="' + parent.data.product_id + '"][id="asp-payment-popup-' + parent.data.uniq_id + '"]'); if(parent.modal.length===0){ jQuery('body').append(''); parent.modal=jQuery('#asp-payment-popup-' + parent.data.uniq_id); } if(show){ window.aspVisibleModalObj=parent.modal; parent.modal.css('display', 'flex').hide().fadeIn(); } var iframe=parent.modal.find('iframe'); parent.iframe=iframe; iframe.on('load', function (){ if(parent.redirectToResult){ window.location.href=iframe[0].contentWindow.location.href; return false; } if(pass_amount){ iframe.contents().find('#amount').val(pass_amount); iframe[0].contentWindow.triggerEvent(iframe.contents().find('#amount')[0], 'change'); } if(parent.data.thankyou_page_url){ iframe.contents().find('#thankyou_page_url').val(parent.data.thankyou_page_url); } iframe[0].contentWindow['doSelfSubmit']=data.doSelfSubmit; parent.iForm=iframe.contents().find('form#payment-form'); parent.iForm.on('submit', function (e){ e.preventDefault(); if(parent.form_submitted){ return false; } var token=parent.iForm.find('input#payment-intent').val(); if(token!==''){ if(parent.form.length===0){ console.log('Waiting for iframe to complete loading'); parent.redirectToResult=true; return true; } var hiddenInputsDiv=parent.form.find('div.asp-child-hidden-fields'); parent.iForm.find('[name!=""]').each(function (){ if(jQuery(this).attr('name')){ jQuery(this).attr('name', 'asp_' + jQuery(this).attr('name')); var clonedItem=jQuery(this).clone(); if(jQuery(this).is('select')){ clonedItem.prop('selectedIndex', jQuery(this).prop('selectedIndex')); } hiddenInputsDiv.append(clonedItem); }}); console.log('Parent form submit'); parent.form_submitted=true; if(parent.isSafari){ parent.checkPPVisible(); }else{ parent.form.submit(); }} return false; }); }); }else{ if(pass_amount){ parent.iframe.contents().find('#amount').val(pass_amount); parent.iframe[0].contentWindow.triggerEvent(parent.iframe.contents().find('#amount')[0], 'change'); } window.aspVisibleModalObj=parent.modal; parent.modal.css('display', 'flex').hide().fadeIn(); parent.iframe[0].contentWindow.popupDisplayed(); }}; var parent=this; parent.data=data; parent.form=jQuery('form#asp_ng_form_' + parent.data.uniq_id); window.WPASPDocumentElementOrigOverflow=jQuery('html').css('overflow'); jQuery('#asp_ng_button_' + parent.data.uniq_id).prop('disabled', false); if(parent.data.preload){ parent.handleModal(false); }else if(parent.data.prefetch){ parent.data.iframe_url=parent.data.iframe_url + '&ckey=' + wpASPNG.ckey; jQuery('body').append(''); } var el='#asp_ng_button_' + parent.data.uniq_id; if(data.attachToElement){ el=data.attachToElement; } jQuery(el).click(function (e){ jQuery('html').css('overflow', 'hidden'); e.preventDefault(); parent.handleModal(true); }); }; function WPASPClosePaymentPopup(){ window.aspVisibleModalObj.fadeOut(); jQuery('html').css('overflow', window.WPASPDocumentElementOrigOverflow); } function WPASPAttachToAElement(el){ var hrefStr=jQuery(el).attr('href'); if(!hrefStr){ return false; } var meinHref=hrefStr.match(/asp_action=show_pp&product_id=[0-9]*(.*)/); if(meinHref[0]){ var productId=meinHref[0].match(/product_id=([0-9]+)/); if(productId[1]){ var params=''; if(meinHref[1]){ params=meinHref[1]; } WPASPAttach(el, productId[1], params); }} return true; } function WPASPAttach(el, prodId, params){ var uniqId=Math.random().toString(36).substr(2, 9); var item_price=jQuery(el).data('asp-price'); if(item_price){ params +='&price=' + item_price; } new stripeHandlerNG({ 'attachToElement': el, 'uniq_id': uniqId, 'product_id': prodId, 'doSelfSubmit': true, 'iframe_url': wpASPNG.iframeUrl + '&product_id=' + prodId + params, 'prefetch': wpASPNG.prefetch==='1' ? true:false }); } function WPASPDocReady(callbackFunc){ if(document.readyState!=='loading'){ callbackFunc(); }else if(document.addEventListener){ document.addEventListener('DOMContentLoaded', callbackFunc); }else{ document.attachEvent('onreadystatechange', function (){ if(document.readyState==='complete'){ callbackFunc(); }}); }} WPASPDocReady(function (){ if(typeof wpaspInitOnDocReady!=='undefined'){ console.log('ASP: Creating buttons on page load'); wpaspInitOnDocReady.forEach(function (data){ new stripeHandlerNG(data); }); } jQuery('[class*="asp-attach-product-"]').each(function (id, el){ var classStr=jQuery(el).attr('class'); var meinClass=classStr.match(/asp-attach-product-[0-9]*/); if(meinClass[0]){ var productId=meinClass[0].match(/([0-9].*)/); if(productId[0]){ WPASPAttach(el, productId[0], ''); }} }); jQuery('a[href*="asp_action=show_pp&product_id="]').each(function (id, el){ WPASPAttachToAElement(el); }); }); (function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t(e||k.height())},_setFocus:function(){(g.st.focus?g.content.find(g.st.focus).eq(0):g.wrap).focus()},_onFocusIn:function(e){if(e.target!==g.wrap[0]&&!d.contains(g.wrap[0],e.target))return g._setFocus(),!1},_parseMarkup:function(o,e,t){var r;t.data&&(e=d.extend(t.data,e)),f(y,[o,e,t]),d.each(e,function(e,t){if(void 0===t||!1===t)return!0;if(1<(r=e.split("_")).length){var n=o.find(w+"-"+r[0]);if(0").attr("src",t).attr("class",n.attr("class"))):n.attr(r[1],t)}}else o.find(w+"-"+e).html(t)})},_getScrollbarSize:function(){if(void 0===g.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),g.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return g.scrollbarSize}},d.magnificPopup={instance:null,proto:e.prototype,modules:[],open:function(e,t){return r(),(e=e?d.extend(!0,{},e):{}).isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return d.magnificPopup.instance&&d.magnificPopup.instance.close()},registerModule:function(e,t){t.options&&(d.magnificPopup.defaults[e]=t.options),d.extend(this.proto,t.proto),this.modules.push(e)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},d.fn.magnificPopup=function(e){r();var t=d(this);if("string"==typeof e)if("open"===e){var n,i=x?t.data("magnificPopup"):t[0].magnificPopup,o=parseInt(arguments[1],10)||0;n=i.items?i.items[o]:(n=t,i.delegate&&(n=n.find(i.delegate)),n.eq(o)),g._openClick({mfpEl:n},t,i)}else g.isOpen&&g[e].apply(g,Array.prototype.slice.call(arguments,1));else e=d.extend(!0,{},e),x?t.data("magnificPopup",e):t[0].magnificPopup=e,g.addGroup(t,e);return t};function T(){S&&(P.after(S.addClass(_)).detach(),S=null)}var _,P,S,E="inline";d.magnificPopup.registerModule(E,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){g.types.push(E),u(l+"."+E,function(){T()})},getInline:function(e,t){if(T(),e.src){var n=g.st.inline,i=d(e.src);if(i.length){var o=i[0].parentNode;o&&o.tagName&&(P||(_=n.hiddenClass,P=p(_),_="mfp-"+_),S=i.after(P).detach().removeClass(_)),g.updateStatus("ready")}else g.updateStatus("error",n.tNotFound),i=d("
");return e.inlineElement=i}return g.updateStatus("ready"),g._parseMarkup(t,{},e),t}}});function z(){M&&d(document.body).removeClass(M)}function O(){z(),g.req&&g.req.abort()}var M,B="ajax";d.magnificPopup.registerModule(B,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){g.types.push(B),M=g.st.ajax.cursor,u(l+"."+B,O),u("BeforeChange."+B,O)},getAjax:function(o){M&&d(document.body).addClass(M),g.updateStatus("loading");var e=d.extend({url:o.src,success:function(e,t,n){var i={data:e,xhr:n};f("ParseAjax",i),g.appendContent(d(i.data),B),o.finished=!0,z(),g._setFocus(),setTimeout(function(){g.wrap.addClass(b)},16),g.updateStatus("ready"),f("AjaxContentAdded")},error:function(){z(),o.finished=o.loadError=!0,g.updateStatus("error",g.st.ajax.tError.replace("%url%",o.src))}},g.st.ajax.settings);return g.req=d.ajax(e),""}}});var L;d.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var e=g.st.image,t=".image";g.types.push("image"),u(C+t,function(){"image"===g.currItem.type&&e.cursor&&d(document.body).addClass(e.cursor)}),u(l+t,function(){e.cursor&&d(document.body).removeClass(e.cursor),k.off("resize"+w)}),u("Resize"+t,g.resizeImage),g.isLowIE&&u("AfterChange",g.resizeImage)},resizeImage:function(){var e=g.currItem;if(e&&e.img&&g.st.image.verticalFit){var t=0;g.isLowIE&&(t=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",g.wH-t)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,L&&clearInterval(L),e.isCheckingImgSize=!1,f("ImageHasSize",e),e.imgHidden&&(g.content&&g.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(t){var n=0,i=t.img[0],o=function(e){L&&clearInterval(L),L=setInterval(function(){0
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){g.types.push(F),u("BeforeChange",function(e,t,n){t!==n&&(t===F?A():n===F&&A(!0))}),u(l+"."+F,function(){A()})},getIframe:function(e,t){var n=e.src,i=g.st.iframe;d.each(i.patterns,function(){if(-1',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% / %total%"},proto:{initGallery:function(){var r=g.st.gallery,e=".mfp-gallery";if(g.direction=!0,!r||!r.enabled)return!1;v+=" mfp-gallery",u(C+e,function(){r.navigateByImgClick&&g.wrap.on("click"+e,".mfp-img",function(){if(1=g.index,g.index=e,g.updateItemHTML()},preloadNearbyImages:function(){var e,t=g.st.gallery.preload,n=Math.min(t[0],g.items.length),i=Math.min(t[1],g.items.length);for(e=1;e<=(g.direction?i:n);e++)g._preloadItem(g.index+e);for(e=1;e<=(g.direction?n:i);e++)g._preloadItem(g.index-e)},_preloadItem:function(e){if(e=j(e),!g.items[e].preloaded){var t=g.items[e];t.parsed||(t=g.parseEl(e)),f("LazyLoad",t),"image"===t.type&&(t.img=d('').on("load.mfploader",function(){t.hasSize=!0}).on("error.mfploader",function(){t.hasSize=!0,t.loadError=!0,f("LazyLoadError",t)}).attr("src",t.src)),t.preloaded=!0}}}});var W="retina";d.magnificPopup.registerModule(W,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(1").addClass(r("Inner")),o=a("");t.after(o.append(i)),o.addClass(s),e.mapClass&&o.addClass(t.attr("class")),e.mapStyle&&o.attr("style",t.attr("style")),t.addClass("hasCustomSelect").on("render.customSelect",function(){n(t,o),t.css("width","");parseInt(t.outerWidth(),10),parseInt(o.outerWidth(),10),parseInt(o.width(),10);o.css({display:"inline-block"});var e=o.outerHeight();t.attr("disabled")?o.addClass(r("Disabled")):o.removeClass(r("Disabled")),i.css({display:"inline-block"}),t.css({"-webkit-appearance":"menulist-button",width:o.outerWidth(),position:"absolute",opacity:0,height:e,fontSize:o.css("font-size")})}).on("change.customSelect",function(){o.addClass(r("Changed")),n(t,o)}).on("keyup.customSelect",function(e){o.hasClass(r("Open"))?13!=e.which&&27!=e.which||n(t,o):(t.trigger("blur.customSelect"),t.trigger("focus.customSelect"))}).on("mousedown.customSelect",function(){o.removeClass(r("Changed"))}).on("mouseup.customSelect",function(e){o.hasClass(r("Open"))||(0x

',t.appendChild(o.childNodes[1])}return e&&n.extend(i,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var o=".fitvidsignore";i.ignore&&(o=o+", "+i.ignore);var t=n(this).find(e.join(","));(t=(t=t.not("object object")).not(o)).each(function(){var e=n(this);if(!(0').parent(".fluid-width-video-wrapper").css("padding-top",100*t+"%"),e.removeAttr("height").removeAttr("width")}})})},n.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(t,i){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("jquery")):t.jQueryBridget=i(t,t.jQuery)}(window,function(e,t){"use strict";var u=Array.prototype.slice,i=e.console,p=void 0===i?function(){}:function(e){i.error(e)};function o(d,n,c){(c=c||t||e.jQuery)&&(n.prototype.option||(n.prototype.option=function(e){c.isPlainObject(e)&&(this.options=c.extend(!0,this.options,e))}),c.fn[d]=function(e){if("string"!=typeof e)return o=e,this.each(function(e,t){var i=c.data(t,d);i?(i.option(o),i._init()):(i=new n(t,o),c.data(t,d,i))}),this;var t,s,r,a,l,o,i=u.call(arguments,1);return r=i,l="$()."+d+'("'+(s=e)+'")',(t=this).each(function(e,t){var i=c.data(t,d);if(i){var o=i[s];if(o&&"_"!=s.charAt(0)){var n=o.apply(i,r);a=void 0===a?n:a}else p(l+" is not a valid method")}else p(d+" not initialized. Cannot call methods, i.e. "+l)}),void 0!==a?a:t},s(c))}function s(e){!e||e&&e.bridget||(e.bridget=o)}return s(t||e.jQuery),o}),function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},o=i[e]=i[e]||[];return-1==o.indexOf(t)&&o.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{};return(i[e]=i[e]||{})[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var o=i.indexOf(t);return-1!=o&&i.splice(o,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var o=this._onceEvents&&this._onceEvents[e],n=0;n